package com.xgg.taiwuinfo.gongfa.base;

import android.content.Context;

import com.xgg.taiwuinfo.R;
import com.xgg.taiwuinfo.gongfa.abilities.Ability_Cast;
import com.xgg.taiwuinfo.gongfa.abilities.Ability_Huti_Counter;
import com.xgg.taiwuinfo.gongfa.abilities.Ability_YunGong_Defend;
import com.xgg.taiwuinfo.utils.GongfaType;

abstract public class Gongfa_Jueji_Huti extends Gongfa
{
    public Gongfa_Jueji_Huti(String name , int level , int element , int inherit , double lasttime , int[] cast)
    {
        super(name,level,element, GongfaType.TYPE_JUEJI_HUTI , inherit);
        mLastTime = lasttime;
        ability_cast = new Ability_Cast(cast[0], cast[1] , cast[2]);
    }
    //持续时间
    Double mLastTime;

    @Override
    public String getTypeString(Context ctx)
    {
        return ctx.getString(R.string.type_jueji);
    }

    public final Ability_Cast ability_cast;

    //施展效果，可能没有
    protected Ability_YunGong_Defend ability_shizhan_defend;
    //反击功能，可能没有
    protected Ability_Huti_Counter ability_huti_counter;

    //施展特效
    public String getCastString(Context ctx)
    {
        String rt = "";
        if (ability_shizhan_defend != null)
            rt = rt + ability_shizhan_defend.getDescString(ctx);
        rt = rt + String.format("持续时间: %.01f\r\n" , mLastTime);
        if (ability_huti_counter != null)
        {
            rt = rt + ability_huti_counter.getCounterString(ctx);
        }
        return rt;
    }

    //获取施法消耗
    public String getCostString(Context ctx)
    {
        return ability_cast.getCostString(ctx);
    }
}
